package com.wtwd.campus.dao;

import com.wtwd.campus.entity.DeleteDeviceAppDto;
import com.wtwd.campus.entity.DeviceApp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wtwd.campus.model.dto.QueryAppDisAbleStateDto;
import com.wtwd.campus.model.vo.QueryDeviceAppVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author mjy
 * @since 2022-12-12
 */
@Mapper
public interface DeviceAppMapper extends BaseMapper<DeviceApp> {


    boolean batchInsertOrUpdate(@Param("list") List<DeviceApp> deviceApps);

    boolean batchDelete(@Param("list") List<DeleteDeviceAppDto> deleteDeviceAppDtos);

    int updateAppDisableFlag(@Param("deviceId") Integer deviceId, @Param("packageName") String packageName, @Param("flag") int flag);

    List<QueryDeviceAppVo> queryDeviceAppByDeviceId(@Param("deviceId") Integer deviceId, @Param("type") int type);

    QueryAppDisAbleStateDto queryAppDisAbleState(@Param("deviceId") Integer deviceId,@Param("packageName") String packageName);
}
